package day2.Animal;

public class Test {
    public static void main(String[] args) {
        //无意义
//        Animal a = new Animal();
//        a.eat();
//        a.sleep();
        System.out.println("===========================");
        Dog dog = new Dog("白",1,1);
        dog.eat();
        dog.sleep();
        System.out.println(dog);
        System.out.println("==========================");
        Cat cat = new Cat("黄",1,2);
        cat.eat();
        cat.sleep();
        System.out.println(cat);


        System.out.println("==============多态==========");
        //多态
        Animal animal = new Dog();
        animal.eat();
        animal.sleep();
        System.out.println("============================");
        Animal animal1 = new Cat();
        animal1.eat();
        animal1.sleep();
    }
}
